package fr.ants.controller.listener;

import java.awt.event.WindowEvent;
import java.awt.event.WindowListener;

import fr.ants.controller.clock.Clock;

/**
 * Listener for the main frame.
 * @author Guillaume Ruscassie
 *
 */
public class FrameListener implements WindowListener {

	/**
	 * Clock.
	 */
	private Clock clock;

	/**
	 * Build.
	 * @param clock Clock
	 */
	public FrameListener(Clock clock) {
		this.clock = clock;
	}

	@Override
	public void windowActivated(WindowEvent e) {
		// do nothing
	}

	@Override
	public void windowClosed(WindowEvent e) {
		//stop the simulation
		clock.stop();

	}

	@Override
	public void windowClosing(WindowEvent e) {
		// do nothing
	}

	@Override
	public void windowDeactivated(WindowEvent e) {
		// do nothing
	}

	@Override
	public void windowDeiconified(WindowEvent e) {
		// do nothing
	}

	@Override
	public void windowIconified(WindowEvent e) {
		// do nothing
	}

	@Override
	public void windowOpened(WindowEvent e) {
		// do nothing
	}

}
